package com.utility.project.controller;

import com.utility.project.common.base.R;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import javax.annotation.Resource;
import com.utility.project.service.IYsBsSettingService;
import com.utility.project.entity.YsBsSetting;

/**
 * @author yangzhiguo
 * @date 2024-10-19
 * @description 
 */
@Api(tags = "系统配置表")
@RestController
@RequestMapping("/ysBsSetting")
public class YsBsSettingController {

    @Resource
    private IYsBsSettingService ysBsSettingService;

    @ApiOperation("通过ID查询单条数据")
    @GetMapping("/queryById")
    public R queryById(@RequestParam("id")Long id){
        return R.ok(ysBsSettingService.getById(id));
    }

    @ApiOperation("新增或修改单条数据")
    @PostMapping("/save")
    public R save(@RequestBody YsBsSetting setting){
        return R.ok(ysBsSettingService.save(setting));
    }


    @ApiOperation("通过code查询单条数据")
    @GetMapping("/queryByCode")
    public R queryByCode(@RequestParam("code")String code){
        return R.ok(ysBsSettingService.queryByCode(code));
    }

    @ApiOperation("查询小程序全局返回true或者false")
    @GetMapping("/queryAppBooleanValue")
    public R queryAppBooleanValue(){
        return R.ok(ysBsSettingService.queryAppBooleanValue());
    }
    
}
